<?php 
header("content-type:text/html;charset=utf8");
//接id
$c_id=$_GET["id"];
$c_name=$_POST["c_name"];
$c_teacher=$_POST["c_teacher"];
$c_descs=$_POST["c_descs"];
$c_time=$_POST["c_time"];
if(!empty($c_id))
{
	echo "<script>if(!confirm('您确定要修改?'))history.go(-1)</script>";
	//连选库
	$db=new PDO("mysql:host=127.0.0.1;dbname=bj07c;charset=utf8","root","root");
	$sql="update class set c_name='$c_name',c_teacher='$c_teacher',c_descs='$c_descs',c_time=$c_time where c_id=$c_id";
	$res=$db->exec($sql);
	if($res)
	{
	   echo "<script>alert('修改成功');location.href='show.php'</script>";
	}
	else
	{
	  echo "<script>alert('修改失败');location.href='show.php'</script>";
	}
}

 ?>